package com.ryh.service;

import com.ryh.dao.LendingRecordDao;
import com.ryh.entity.LendingRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LendingRecordService {

    @Autowired
    private LendingRecordDao lendingRecordDao;

    public List<LendingRecord> getLendingRecordsByReaderId(String readerId) {
        return lendingRecordDao.getLendingRecordsByReaderId(readerId);
    }

    public List<LendingRecord> getLendingRecordsByBookId(String bookId) {
        return lendingRecordDao.getLendingRecordsByBookId(bookId);
    }

    public LendingRecord getLendingRecordById(String recordId) {
        return lendingRecordDao.getLendingRecordById(recordId);
    }

    public void addLendingRecord(LendingRecord lendingRecord) {
        lendingRecordDao.addLendingRecord(lendingRecord);
    }

    public void updateLendingRecord(LendingRecord lendingRecord) {
        lendingRecordDao.updateLendingRecord(lendingRecord);
    }

    public void deleteLendingRecord(String recordId) {
        lendingRecordDao.deleteLendingRecord(recordId);
    }
}